import axios from 'axios'

const ROLE_BASE_REST_API_URL = "http://localhost:8090/api/v1/roles";

class RolesService{
    



    getAllRoles(){
        return axios.get(ROLE_BASE_REST_API_URL)

    }
    create(role){
        return axios.post(ROLE_BASE_REST_API_URL,role)
    }
    getRoleById(roleId){
        return axios.get(ROLE_BASE_REST_API_URL +"/" + roleId)
    }
    updataRole(roleId,role){
        return axios.put(ROLE_BASE_REST_API_URL + "/" + roleId,role)
    }
    getEmployeeByRoleId(roleId){
        return axios.get(ROLE_BASE_REST_API_URL + "/getByRole/" + roleId)
    }
    deleteRole(roleId){
        return axios.delete(ROLE_BASE_REST_API_URL +"/" + roleId);
    }



}

export default new RolesService();